<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/common/taglib.jsp" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> 
<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>讨论组</title>
	<%@include file="/WEB-INF/common/static.jsp" %>
	<script type="text/javascript">
		function loadComments(){
			$("#allComments").load("${ctx}/officeManage/groupManange/showAllComments.do",{
				groupId : $("#groupId").val()
			});
		}
		function publishTask(button){
			$(button).attr("href","#taskModal");
		}
		
		function publishComment(){
			var content = $("#commentContent").val();
			if(content == ''){
				alert("请输入评论内容");
				return false;
			}
			$.post("${ctx}/officeManage/groupManange/addComment.do",{
	        		groupId : $("#groupId").val(),
	        		content : $("#commentContent").val()
	        	},function(data){
	        		if(200 == data.code){
	        			loadComments();
	        		}else{
	        			alert("添加失败！失败原因：" + data.data);
	        		}
	        	},"json")
		}
	</script>
	<style>
		.checkbox-inline{
			width:70px;
			margin-left:0!important;
		}
		.hfname{
			color:#00CC99;

		}
		.hrefcontent,.timeget{
			text-align:left!important;
			font-weight:normal;
			padding-top:30px!important;
		}
		img{
			width:40px;
			height:40px;
		}
		#hrefwordContainer{
			border-top:1px solid #ccc;
		}
	</style>
</head>
<body onload="loadComments();">
    <ul class="nav nav-tabs" role="tablist">
    		<li role="presentation">
				<a href="${ctx }/officeManage/noteManange/nofinishedNotes.do">待办事务</a>
			</li>
   		<li role="presentation" class="active" >
			<a href="javascript:void(0)"  target="mainFrame" >讨论组</a>
		</li>
	</ul>
	
	<input type="hidden" id="groupId" value="${group.id }"/>
	
	<div class="container" style="margin:0 0 0 25px;">
		<div class="form-horizontal">
			<div class="form-group" style="padding-top:20px;margin-bottom:8px;">
				<label class="col-sm-2 control-label">标题：</label>
				<label class="control-label abc" style="font-weight:normal">${noteInfo.name }</label>
				<button type="button" class="btn btn-primary"  data-toggle="modal" 
							style="float:right;margin-right:80px;" onclick="publishTask(this);">指派任务</button>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">发起人：</label>
				<label class="control-label admin" style="font-weight: normal">${user.userName }</label>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">联系人：</label>
				<label class="control-label ghi" style="font-weight: normal">
					<c:forEach var="user" items="${groupUsers }">
						${user.userName };
					</c:forEach>
				</label>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">主要内容：</label>
				<label class="control-label col-sm-8 def" style="font-weight: normal;text-align:left;padding-left:0;padding-right:0;">
					${noteInfo.content }
				</label>
			</div>
			<div class="form-group">
				<label class="control-label col-sm-1"></label>
				<div class="input-group col-sm-10">
					<input type="text" class="form-control"  id="commentContent" placeholder="快速回复给：全部组员" style="border:0!important;">
					<div class="input-group-addon btn btn-primary"  onclick="publishComment();">回复</div>
				</div>
			</div>
			
		<!-- <div id="taskModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true" style="color:white">x</button>
                            <span>任务编写</span>
                        </div>
                        <div class="modal-body">
                        	<div class="form-group" style="padding:0 10px;margin-bottom:0!important;">
								<label for="publishVersion">任务名称：</label>
								<input type="text" class="form-control testName" placeholder="例如平台维护">
                        	</div>
                        	<div class="form-group" style="padding:0 10px;margin-bottom:0!important;">
								<label class="control-label">指派人：</label>
								<br>
								<label class="checkbox-inline">
					  				<input type="checkbox" name="namebox" value="3">韩朝祥
								</label>
                        	</div>
                        	<div class="form-group" style="padding:10px;margin-bottom:0!important;">
								<label>通知内容：</label>
								<textarea name="publishDescribe" id="publishDescribe" rows="10" cols="80">
					                <label style="font-weight:normal;padding:5px 20px">
					                    内容
					                </label>
					            </textarea>
					            <script>
					                CKEDITOR.replace( 'publishDescribe' );
					            </script>
						</div>
                    	</div>
                    	<div class="modal-footer">
                        	<button class="btn btn-primary singleperson" aria-hidden="true" onclick="">确定</button>
                    	</div>
                    </div>
                </div>
        </div>
         -->
		<div class="form-horizontal" id="allComments">
			
		</div>
		
	</div>
	</div>
</body>
</html>